package com.lyhengtongwl.zqsnews.newsNotify;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class NoticeCancelBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String acton = intent.getAction();
        assert acton != null;
        if (acton.equals("notice_cancel")) {
            int id = intent.getIntExtra("id", -1);
            if (id != -1) {
                NotificationManager notificationManager =
                        (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
                notificationManager.cancel(id);
            }
        }
    }
}
